@use "../utils";

.rio-custom-tree-item {
    pointer-events: auto;

    padding: 0.2rem;

    display: flex;
    flex-direction: column;
}

.rio-tree-header-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rio-custom-tree-item.rio-selectable-item > .rio-tree-header-row {
    cursor: pointer;
}
.rio-custom-tree-item.rio-selectable-item > .rio-tree-header-row:hover {
    background: var(--rio-local-bg-active);
}
.rio-custom-tree-item.rio-selectable-item.selected > .rio-tree-header-row {
    background-color: var(--rio-global-secondary-bg);
}
.rio-custom-tree-item.rio-selectable-item.selected
    > .rio-tree-header-row:hover {
    background: var(--rio-global-secondary-bg-active);
}

.rio-tree-expand-button-container {
    @include utils.single-container();

    // Assign a minimum size so that the width hopefully stays consistent even
    // if the user uses weird custom arrow elements
    min-width: 1rem;

    &[role="button"]:not([aria-disabled="true"]):hover {
        background-color: rgba(255, 255, 255, 0.15);
        border-radius: utils.$infinite-corner-radius;
    }
}

.rio-tree-content-container {
    transition: background-color 0.1s ease-out;

    &:hover {
        background: var(--hover-color);
    }
}

.rio-tree-children-container {
    margin-left: 1.5rem;
}
